<template>
  <div class="fav-list">
    <div v-for="img in imgs" :style="'flex-grow: ' + img.width*100/img.height + '; flex-basis:' + img.width*240/img.height+'px;'">
      <i :style="'padding-bottom: ' + img.height/img.width*100 + '%'"></i>
      <img :src="img.url"/>
    </div>
    <div v-for="i in [1,2,3,4,5,6,7,8,9,10]" class="placeholder"></div>
  </div>
</template>

<script>
  export default {
    data () {
      return {
        imgs: [
          {
            width: 333,
            height: 500,
            url: 'https://xieranmaya.github.io/images/cats/stock-photo-74402039.jpg'
          },
          {
            width: 500,
            height: 333,
            url: 'https://xieranmaya.github.io/images/cats/stock-photo-132586903.jpg'
          },
          {
            width: 500,
            height: 333,
            url: 'https://xieranmaya.github.io/images/cats/stock-photo-132046989.jpg'
          },
          {
            width: 500,
            height: 333,
            url: 'https://xieranmaya.github.io/images/cats/stock-photo-147969173.jpg'
          },
          {
            width: 333,
            height: 500,
            url: 'https://xieranmaya.github.io/images/cats/stock-photo-145414771.jpg'
          },
          {
            width: 500,
            height: 281,
            url: 'https://xieranmaya.github.io/images/cats/stock-photo-132311221.jpg'
          }
        ]
      }
    }
  }
</script>

<style>
  body{
    margin: 0;
    overflow-x: hidden;
  }
  .fav-list{
    display: flex;
    flex-wrap: wrap;
    margin: 2px;
  }
  /* .fav-list::after{
    content: '';
    flex-grow: 999999999;
    order: 999999999;
  } */
  .fav-list > div{
    margin: 2px;
    background-color: violet;
    position: relative;
  }
  .fav-list > div > i {
    display: block;
    background-color: lightblue;
    /* display: none; */
  }
  .fav-list > div > img {
    position: absolute;
    vertical-align: bottom;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .fav-list > .placeholder{
    flex-grow: 100;
    flex-basis: 240px;
    height: 0;
    margin: 0;
  }
</style>
